<template>
  <vxe-column
    :field="field"
    :title="title"
    :sortable="sortable"
    :width="width"
    :align="align"
    :listItemType="listItemType"
    :edit-render="editRender"
  >
    <template #edit="{ row }">
      <vxe-number-input v-if="listItemType == '2-2'" v-model="row.num" />
    </template>
  </vxe-column>
</template>

<script lang="ts" setup>
/**
 * 1-默认
 * 2-1 输入框 文本
 * 2-2 输入框 数字
 */

import { defineProps } from "vue"

// 定义列组件的 props，可以传递给 `vxe-column`
const props = defineProps({
  field: {
    type: String,
    required: true
  },
  title: {
    type: String,
    required: true
  },
  sortable: {
    type: Boolean,
    default: false
  },
  width: {
    type: Number,
    default: 100
  },
  align: {
    type: String,
    default: "center"
  },
  editRender: {
    type: Object,
    default: null
  },
  listItemType: {
    type: String,
    default: 1
  }
})
</script>
